package com.hui.wanxin.web.common.service.impl;

import com.hui.wanxin.web.common.mq.entity.SmsVo;
import com.hui.wanxin.web.common.service.SmsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * @author: 灰灰
 * @date: 2023年10月14日 12:59
 * @ClassName: SmsServiceImpl
 * @Description: TODO
 */
@Service
@Slf4j
public class SmsServiceImpl implements SmsService {

    @Autowired
    private RedisTemplate redisTemplate;

    @Override
    public void sendMessage(SmsVo smsVo) {

    }

    @Override
    public void sendCode(String phone, Integer code) {

        redisTemplate.opsForValue().set("userLogin:"+phone,code,10, TimeUnit.MINUTES);

    }
}
